package com.mioto.ld.communication.mqtt.protocol.model.server;

import cn.hutool.json.JSONConfig;
import cn.hutool.json.JSONUtil;
import com.mioto.ld.communication.mqtt.protocol.model.PType;
import com.mioto.ld.communication.mqtt.protocol.model.Payload;
import lombok.Getter;
import lombok.Setter;

/**
 * @author mioto-qinxj
 * @date 2024/5/27
 * @desc
 */
@Getter
@Setter
public class DeiveClosePayload extends Payload {

    private String ptype = PType.SERVER_REMOTE_SHUTDOWN;

    private int power;

    public DeiveClosePayload(){

    }
    public DeiveClosePayload(int power){
        this.power = power;
    }

    @Override
    public String toJsonStr() {
        return JSONUtil.createObj(new JSONConfig().setOrder(true)).set("ptype",ptype).set("power",power).toString();
    }
}
